Public Sub Cancel(ByVal npreq1)
        Dim trace As Integer
        Dim text$

        trace = 0
        If trace_pp = 1 Then trace = 1
        If trace = 1 Then
            text$ = "Cancel   np " + Str(np) + Str(npreq1)
            If trace_pp = 1 Then
                DISPLAY1(indd1, text$)
            Else
                Debug.Print(text$)
            End If
        End If
        If npreq1 < np Then
            For i = 1 To np
                text$ = ""
                Application.DoEvents()
                Select Case i
                    Case Is = 1
                        state1(i) = CancelSt
                        If trace = 1 Then text$ = "Cancel " + Str(i)
                    Case Is = 2
                        state1(i) = CancelSt
                        If trace = 1 Then text$ = "Cancel " + Str(i)
                    Case Is = 3
                        state1(i) = CancelSt
                        If trace = 1 Then text$ = "Cancel " + Str(i)
                    Case Is = 4
                        state1(i) = CancelSt
                        If trace = 1 Then text$ = "Cancel " + Str(i)
                End Select
                If text$ <> "" Then
                    If trace_pp = 1 Then
                        DISPLAY1(indd1, text$)
                    Else
                        Debug.Print(text$)
                    End If
                End If
            Next i
        End If
        np = npreq1
        state2(1) = Endst
        state1(1) = 0
        Form4.Tnp.Text = Str(np)
    End Sub